package com.pinda.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pinda.base.entity.PdTruckDriverLicense;
import com.pinda.service.IPdTruckDriverLicenseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 司机驾驶证表 前端控制器
 * </p>
 *
 * @author lc
 * @since 2023-06-14
 */
@RestController
@RequestMapping("/pd-truck-driver-license")
public class PdTruckDriverLicenseController {

    @Autowired
    IPdTruckDriverLicenseService iPdTruckDriverLicenseService;


    @RequestMapping("queryTruckDriverLicenseByUserId/{id}")
    public PdTruckDriverLicense queryTruckDriverLicenseByUserId(@PathVariable("id") String id){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("user_id",id);
        return this.iPdTruckDriverLicenseService.getOne(queryWrapper);
    }


    @RequestMapping("updateTruckDriverLicense")
    public boolean updateTruckDriverLicense(@RequestBody PdTruckDriverLicense pdTruckDriverLicense){
        return this.iPdTruckDriverLicenseService.updateById(pdTruckDriverLicense);
    }

}
